$OpenBSD: patch-src_plugins_compilergcc_compilergcc_cpp,v 1.4 2016/01/30 11:20:01 ajacoutot Exp $

Always use cb_console_runner from installed PREFIX.

--- src/plugins/compilergcc/compilergcc.cpp.orig	Sat Jan 23 11:43:05 2016
+++ src/plugins/compilergcc/compilergcc.cpp	Fri Jan 29 00:27:33 2016
@@ -159,7 +159,7 @@ namespace
 {
     PluginRegistrant<CompilerGCC> reg(_T("Compiler"));
 
-    static const wxString strCONSOLE_RUNNER(platform::windows ? _T("cb_console_runner.exe") : _T("cb_console_runner"));
+    static const wxString strCONSOLE_RUNNER(platform::windows ? _T("cb_console_runner.exe") : _T("${PREFIX}/bin/cb_console_runner"));
     static const wxString strSLASH(_T("/"));
     static const wxString strSPACE(_T(" "));
     static const wxString strQUOTE(platform::windows ? _T("\"") : _T("'"));
@@ -1723,8 +1723,7 @@ int CompilerGCC::RunSingleFile(const wxString& filenam
 
     wxString baseDir = ConfigManager::GetExecutableFolder();
     wxString crunnStr = strQUOTE + baseDir + strSLASH + strCONSOLE_RUNNER + strQUOTE;
-    if ( wxFileExists(baseDir + strSLASH + strCONSOLE_RUNNER) )
-        command << crunnStr << strSPACE;
+        command << strCONSOLE_RUNNER << strSPACE;
 
     if (!command.Replace(_T("$SCRIPT"), exe_filename))
         command << strQUOTE << exe_filename << strQUOTE; // if they didn't specify $SCRIPT, append:
@@ -1838,7 +1837,7 @@ int CompilerGCC::Run(ProjectBuildTarget* target)
                     : EscapeSpaces(m_CdRun);
     wxString crunnStr = platform::windows
                       ? strQUOTE + baseDir + strSLASH + strCONSOLE_RUNNER + strQUOTE
-                      : EscapeSpaces(baseDir + strSLASH + strCONSOLE_RUNNER);
+                      : EscapeSpaces(strCONSOLE_RUNNER);
     wxString hostapStr = platform::windows
                        ? strQUOTE + target->GetHostApplication() + strQUOTE
                        : EscapeSpaces(target->GetHostApplication());
@@ -1876,8 +1875,6 @@ int CompilerGCC::Run(ProjectBuildTarget* target)
 
         if (target->GetUseConsoleRunner())
         {
-            if (wxFileExists(baseDir + strSLASH + strCONSOLE_RUNNER))
-            {
                 command << crunnStr << strSPACE;
 
                 if (!platform::windows)
@@ -1889,7 +1886,6 @@ int CompilerGCC::Run(ProjectBuildTarget* target)
                     QuoteStringIfNeeded(strLinkerPath);
                     command << strLinkerPath << strSPACE;
                 }
-            }
         }
     }
 
